import  multiprocessing as mp
import psutil as ps
import numpy as np
import tensorflow as tf

# current_processing = mp.current_process() # 获取当前进程
# CPU_locCount = mp.cpu_count() # 获取逻辑 cpu数量
# CPU_phyCount = ps.cpu_count(logical=False) # 获取物理 cpu数量
# CPU_locCount_ = ps.cpu_count(logical=True) # 获取逻辑 cpu数量
#
# print(current_processing)
# print(CPU_locCount)
# print(CPU_phyCount)
# print(CPU_locCount_)
# a = np.array([1,2,3,4,5])
# b = np.array([[1,3],[3,2],[5,3,6],[1,85,64,647,54]])
# print(a.shape)
# print(b.shape)

matrix = np.array([
    [1,1,1,1,1,1],
    [2,2,2,2,2,2],
    [3,3,3,3,3,3],
    [4,4,4,4,4,4]
])

x = np.array([
    [0,1,2,3,2],
    [2,1,1,2,1]

])
result = tf.nn.embedding_lookup(matrix,x)
with tf.Session() as sess:
    print(sess.run(result))
    print(sess.run(result))